<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta charset="UTF-8">
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Cache" content="no-cache">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <title>首页</title>
    <link rel="stylesheet" href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" />
    <link rel="stylesheet" href="../static/layer/mobile/need/layer.css" th:href="@{/layer/mobile/need/layer.css}" />
    <link rel="stylesheet" href="../static/css/main.css" th:href="@{/css/main.css}" />
</head>
<body>
<div class="header">
    <div class="container">
<!--        <img src="../static/image/banner.jpg"  th:src="@{image/banner.jpg}" alt=""/>-->
    </div>
</div>

<div class="searchBar">
    <div class="container">
        <div class="left ">
                <img class="dateImg f_l" th:src="@{image/date_icon.png}"  alt=""/>
                <p class="date no_fl"></p>
        </div>
        <div class="right">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="请输入关键词进行快速查询">
                <button type="submit" class="btn btn-default" id="searchBtn">搜索</button>
            </div>
        </div>
    </div>
</div>

<div class="container">
<!--part2-->
    <section class="section">
    <div class="part_2">
        <div class="title">
            <span >部门行政执法公示</span>
        </div>

        <div class="row clearfix">

        </div>
    </div>
</section>
    <!--part3-->
    <section class="section">
        <div class="part_3">
            <div class="title">
                <span >乡镇（街道）行政执法公示</span>
            </div>

            <div class="row clearfix">
           </div>
        </div>
    </section>
<!--part4-->
    <section class="section">
    <div class="part_4">
        <div class="row">
            <div class="col-xs-6">
                <div class="title">
                    <span>事前公开</span>
<!--                    <a href="">更多></a>-->
                </div>
                <div>
                    <ul  class="startList">
                    </ul>
                </div>
            </div>

            <div class="col-xs-6">
                <div  class="title">
                    <span>事后公开</span>
<!--                    <a href="">更多></a>-->
                </div>
                <div>
                    <ul class="endList">
                    </ul>
                </div>
            </div>
        </div>
    </div>
 </section>

<!--    part5-->
    <section class="section" >
        <div class="part_5">
            <div class="title">
                <span >行政复议公示</span>
            </div>

            <div class="row">
                <div class="col-xs-4">
                    <div data-level1="1" data-lever2="101" typeId="1" >
                        <img src="../static/image/home_icon_1@2x.png"  th:src="@{image/home_icon_1@2x.png}"  alt=""/>
                        <span>行政复议事前公示</span>
                    </div>
                </div>

                <div class="col-xs-4">
                    <div data-level1="2" data-lever2="102" typeId="2"  >
                        <img src="../static/image/home_icon_2@2x.png" th:src="@{image/home_icon_2@2x.png}"  alt=""/>
                        <span>行政复议事后公示</span>
                    </div>
                </div>

                <div class="col-xs-4">
                    <div typeId="3" >
                        <img src="../static/image/home_icon_3@2x.png" th:src="@{image/home_icon_3@2x.png}"  alt=""/>
                        <span>行政复议在线申请</span>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<div class="footer">
    
    
</div>
</body>
<script src="../static/js/jquery-3.4.1.min.js" th:src="@{js/jquery-3.4.1.min.js}"></script>
<script src="../static/js/common.js"  th:src="@{js/common.js}"></script>
<script src="../static/js/bootstrap.min.js"  th:src="@{js/bootstrap.min.js}"></script>
<script src="../static/layer/layer.js"  th:src="@{layer/layer.js}"></script>
<script type="text/javascript">

var currentTime=formatDate();
$('.date').html('今天是：'+currentTime);

 getNew();
  function getNew() {
    $.ajax({
      url: "/rqzf/topping",
      method:'GET',
      success:function(ret){
        if(ret.success==0){
          var str = '';var str1='';
          var type='';
          var data=ret.data
         data.forEach(function(val){
          type=val.lv1Type;
           if(type==1){
            str +=
                    '<li title='+val.title+' resType='+val.resType+' createTime='+val.createTime+'  unitName='+val.unitName+' id='+val.id+' resUrl='+val.resUrl+' >'+
                        '<i class="point"></i>'+
                        '<p>'+val.title+'</p>'+
                        '<span>'+val.createTime+'</span>'+
                    '</li>'

                 $('.startList').html(str)
             }
          if(type==2){
            str1+=
                 '<li title='+val.title+' resType='+val.resType+'   createTime='+val.createTime+'  unitName='+val.unitName+' id='+val.id+' resUrl='+val.resUrl+' >'+
                        '<i class="point"></i>'+
                        '<p>'+val.title+'</p>'+
                        '<span>'+val.createTime+'</span>'+
                  '</li>'

                 $('.endList').html(str1)
            }
          });
        }
      }
    })
  }


  getAll();
  function getAll(){
    $.ajax({
      url: "/rqzf/getUnit",
      method:'GET',
      success:function(ret){
        if(ret.success==0){
          var str = '';var _str='';
          var unitType='';
          ret.data.forEach(function(val){
          unitType=val.pos;
            if(unitType==0){
             str +=

                '<div class="col-xs-2" id='+val.id+' name='+val.name+'>'+
                  '<a>'+
                    '<div class="clearfix item">'+
                        '<img src='+val.icon+' alt=""/>'+
                        '<p>'+val.name+'</p>'+
                    '</div>'+
                   '</a>'+
               '</div>'

                 $('.part_2 .row').html(str);
            }else{
             _str +=  '<div class="col-xs-2" id='+val.id+' name='+val.name+'>'+
                     '<a>'+
                       '<div class="clearfix item">'+
                            '<p>'+val.name+'</p>'+
                        '</div>'+
                     '</a>'+
                '</div> ';
            }
            $('.part_3 .row').html(_str);
            });
        }
      }
    })
  }

$('.part_2 .row').on('click','div',function(){
    var id=$(this).attr('id');
    var name=$(this).attr('name');
     window.location.href='list?id='+id+'&name='+name+'&formType=4';
})
$('.part_3 .row').on('click','div',function(){
    var id=$(this).attr('id');
    var name=$(this).attr('name');
    window.location.href='list?id='+id+'&name='+name+'&formType=4';
})


$('.part_1 .row>div>div').click(function(){
    var level1=$(this).attr('data-level1');
    var level2=$(this).attr('data-lever2');
    var names=$(this).find('span').text();
    if(level1==1){
        names='事前公开>'+$(this).find('span').text();
    }else{
       names='全部'
    }
    window.location.href='list?level1='+level1+'&level2='+level2+'&names='+names+'&formType=3';
})


$('.part_4 ul').on('click','li',function(){
    var resType=$(this).attr('resType');
    var title=$(this).attr('title');
    var createTime=$(this).attr('createTime');
    var unitName=$(this).attr('unitName');
    var resUrl=$(this).attr('resUrl');
    var id=$(this).attr('id');
    window.location.href='details'+'/'+id;
})

$('#searchBtn').click(function(){
    var keywords=$('input').val();
    if(keywords==''){
        layer.msg('请输入关键字查询！')
        return;
    }
   window.location.href='list?keywords='+keywords+'&formType=2';
})


$('.part_5 .row>div>div').click(function(){
    var level1=$(this).attr('data-level1');
    var level2=$(this).attr('data-lever2');
    var names=$(this).find('span').text();
    var typeId=$(this).attr('typeId');
    var id=$(this).attr('data-id');
    window.location.href='admin_list?level1='+level1+'&level2='+level2+'&names='+names+'&typeId='+typeId+'&formType=5';
})




</script>
</html>